package com.tencent.iov.cowin.befsale.clue.service.clue;

import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.request.AccessAddClueInitialRequest;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.request.AddClueInitialAfterWashRequest;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.ThirdCreateClueInitialResponse;
import com.tencent.iov.cowin.befsale.clue.dao.kafka.response.ClueInitialCrm;
import com.tencent.iov.cowin.befsale.clue.domain.clue.po.ClueInitial;
import com.software.boot.common.model.dao.PageRequest;
import com.software.boot.common.model.dao.PageResponse;

import java.util.List;

/**
 * @Describe: 线索源信息表_Service接口层
 * @author: whp
 * @created: 2021-12-21 16:16:11
 * @version: 1.0
 */

public interface ClueInitialService {

    /**
     * 通过ID获取详细信息
     *
     * @param: id
     * @return: ClueInitial对象
     */
    ClueInitial getDetailById(Integer id);

    /**
     * 单条数据插入ClueInitial
     *
     * @param request
     * @return 插入的条数
     */
    Long insert(ClueInitial request);



    /**
     * 批量插入ClueInitial
     *
     * @param requests
     * @return 批量插入的条数
     */
    int insertBatch(List<ClueInitial> requests);

    /**
     * 单条ClueInitial更新
     *
     * @param request
     * @return 更新的条数
     */
    int update(ClueInitial request);

    /**
     * 通过ID删除数据
     *
     * @param request
     * @return 删除的条数
     */
    int delete(ClueInitial request);

    /**
     * 根据条件查询对象list列表
     *
     * @param request
     * @return 查询结果
     */
    List<ClueInitial> getListByParam(ClueInitial request);

    /**
     * 根据条件查询对象Page记录
     *
     * @param request
     * @return 查询结果
     */
    PageResponse<ClueInitial> getPageByParam(PageRequest<ClueInitial> request);

    /**
     * 接口清洗
     *
     * @param
     * @return
     */
    int washHandle();

    /**
     * 根据条件查询对象-单个
     *add by zly
     * 2022-01-20
     * @param request
     * @return 查询结果
     */
    ClueInitial getOneclueInitialByParam(ClueInitial request);

    /**
     * add by zly
     * 2022-01-20
     * 接收清洗后的数据
     * @param request
     * @return
     */
    Integer receiveAfterWash(AddClueInitialAfterWashRequest request);

    /**
     * 同步线索源信息到crm
     * add by zly 2022-01-22
     * @param sysnTime
     * @return
     */
    Boolean syncClueInitialToCrm(String sysnTime);

    /**
     * 单条数据插入ClueInitial
     * add by zly
     * 2022-01-22
     * 接收从第三方创建的线索-入库线索源
     * @param request
     * @return 插入的条数
     */
    ThirdCreateClueInitialResponse accessAdd(AccessAddClueInitialRequest request);

    /**
     * 同步crm老数据入库线索源
     * @param clueLead
     */
    void sysnOldClueFromMq(ClueInitialCrm clueLead);

    void syncInsertClueTest(String crmCLueId,Integer leadStatus);
}